package(default_visibility = ["//visibility:public"])

licenses(["notice"])  # Apache 2.0

load("//tools/build_defs:javac.bzl", "JAVACOPTS_OSS")

java_library(
    name = "webpush",
    srcs = glob([
        "src/main/**/*.java",
    ]),
    javacopts = JAVACOPTS_OSS,
    deps = [
        "//java",
        "//java:subtle",
    ],
)

# Maven Jars

load("//tools:gen_maven_jar_rules.bzl", "gen_maven_jar_rules")

gen_maven_jar_rules(
    name = "maven",
    doctitle = "Tink Cryptography API for Message Encryption for Web Push (RFC 8291)",
    root_packages = ["com.google.crypto.tink.apps.webpush"],
    deps = [":webpush"],
)

# Tests

load("//tools:gen_java_test_rules.bzl", "gen_java_test_rules")

java_library(
    name = "generator_test",
    testonly = 1,
    srcs = glob([
        "src/test/**/*.java",
    ]),
    deps = [
        ":webpush",
        "//java:testonly",
        "@junit",
    ],
)

gen_java_test_rules(
    test_files = glob([
        "src/test/**/*Test.java",
    ]),
    deps = [
        ":generator_test",
    ],
)
